
#if defined(WIN32) || defined(WIN64)
#pragma unmanaged
#endif

#include <Liberty3D/Engine/Component.h>

#include <Liberty3D/Engine/GameObject.h>

using namespace Liberty::Engine;

Component::Component() : _calls(0) {
}

Component::~Component() {
}

std::shared_ptr<Context> Component::context() const {
    std::shared_ptr<GameObject> go(gameObject());

    if (go) {
        return go->context();
    }

    return std::shared_ptr<Context>();
}

std::string Component::name() const {
    std::shared_ptr<GameObject> go(gameObject());

    if (go) {
        return go->name();
    }

    return std::string();
}

void Component::setName(const std::string& name) {
    std::shared_ptr<GameObject> go(gameObject());

    if (go) {
        go->setName(name);
    }
}

void Component::onStart() {
}

void Component::onUpdate() {
}

void Component::onLateUpdate() {
}

void Component::onFixedUpdate() {
}

void Component::onPreCull() {
}

void Component::onWillRenderObject() {
}

void Component::onRenderObject() {
}

void Component::onPostRender() {
}

void Component::onRenderImage() {
}

void Component::onGui() {
}

void Component::onDrawGizmos() {
}

int Component::order() const {
    return 0;
}

std::shared_ptr<IObjectMethod> Component::findMethod(const std::string& methodName) {
    return std::shared_ptr<IObjectMethod>();
}

bool Component::staticComponent() const {
    return false;
}

void Component::serializeObject(ISerializer*) {
    throw std::exception();
}
